enum SynDataType {
  SynConfig,
  SynDepartment,
  SynUser,
  SynGroup,
  SynModule,
  SynSession,
  SynMessage,
  SynCollect,
  SynLabel,
  SynSensitiveWord,
  ;

}

enum LoadingState {
  init,
  loading,
  success,
  failure,
  ;
}

enum LoadingType {
  init,   // 初次加载
  news,   // 加载新数据
  old,    // 加载旧数据
  ;
}

enum UserAndGroupType {
  user,
  group,
  ;

  static UserAndGroupType ofName(String? name) {
    UserAndGroupType? result = UserAndGroupType.values.firstWhere((e) => e.name == name);
    return result;
  }
}

enum LoginType {
  password(1, "密码登录"),
  token(2, "无秘"),
  slidePassword(3, "滑动登录"),
  scanLock(4, "扫码登录")
  ;

  final int value;
  final String desc;

  const LoginType(this.value, this.desc);

  static LoginType ofValue(int? value) {
    LoginType? result = LoginType.values.firstWhere((e) => e.value == value);
    return result;
  }
}